// import com.alibaba.druid.DbType;
// import com.alibaba.druid.sql.ast.*;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;
#pragma once
#include "../SQLStatementImpl.h"
#include "SQLCreateStatement.h"

class SQLCreateTriggerStatement_TriggerType
{
public:
  static SQLCreateTriggerStatement_TriggerType_ptr BEFORE;
  static SQLCreateTriggerStatement_TriggerType_ptr AFTER;
  static SQLCreateTriggerStatement_TriggerType_ptr INSTEAD_OF;
  uint64_t mask;
  string_ptr name;
  SQLCreateTriggerStatement_TriggerType(uint64_t mask, string_ptr name);
};

class SQLCreateTriggerStatement_TriggerEvent
{
public:
  static SQLCreateTriggerStatement_TriggerEvent_ptr INSERT;
  static SQLCreateTriggerStatement_TriggerEvent_ptr UPDATE;
  static SQLCreateTriggerStatement_TriggerEvent_ptr DELETE;
  uint64_t mask;
  string_ptr name;
  SQLCreateTriggerStatement_TriggerEvent(uint64_t mask, string_ptr name);
};

class SQLCreateTriggerStatement 
: virtual public SQLStatementImpl, 
virtual public SQLCreateStatement
{
public:
  SQLName_ptr name;
  BOOL_ptr orReplace;
  SQLCreateTriggerStatement_TriggerType_ptr triggerType;

  SQLName_ptr definer;

  BOOL_ptr update;
  BOOL_ptr delete_;
  BOOL_ptr insert;

  SQLExprTableSource_ptr on;

  BOOL_ptr forEachRow;

  SQLName_list_ptr updateOfColumns;

  SQLExpr_ptr when;
  SQLStatement_ptr body;

  SQLCreateTriggerStatement();

  SQLCreateTriggerStatement(DbType_ptr dbType);
  SHAREDOBJECT(SQLCreateTriggerStatement);

  void accept0(SQLASTVisitor_ptr visitor);

  // @Override
  SQLObject_list_ptr getChildren();

  SQLExprTableSource_ptr getOn();

  void setOn(SQLName_ptr on);

  void setOn(SQLExprTableSource_ptr on);

  SQLName_ptr getName();

  void setName(SQLName_ptr name);

  SQLStatement_ptr getBody();

  void setBody(SQLStatement_ptr body);

  BOOL_ptr isOrReplace();

  void setOrReplace(BOOL_ptr orReplace);

  SQLCreateTriggerStatement_TriggerType_ptr getTriggerType();

  void setTriggerType(SQLCreateTriggerStatement_TriggerType_ptr triggerType);

  SQLCreateTriggerStatement_TriggerEvent_list_ptr getTriggerEvents();

  BOOL_ptr isForEachRow();

  void setForEachRow(BOOL_ptr forEachRow);

  SQLName_list_ptr getUpdateOfColumns();

  SQLExpr_ptr getWhen();

  void setWhen(SQLExpr_ptr x);

  BOOL_ptr isUpdate();

  void setUpdate(BOOL_ptr update);

  BOOL_ptr isDelete();

  void setDelete(BOOL_ptr delete_);

  BOOL_ptr isInsert();

  void setInsert(BOOL_ptr insert);

  SQLName_ptr getDefiner();

  void setDefiner(SQLName_ptr x);

  // @Override
  SQLDDLStatement::DDLObjectType getDDLObjectType();
};
